home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9409 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  880 b 

  1. Path: jake.esu.edu!pan7064
  2. From: pan7064@kutztown.edu (Jian Pan)
  3. Newsgroups: comp.lang.c++
  4. Subject: help: template class, #include myclass.cpp?
  5. Date: 1 Mar 1996 15:45:55 GMT
  6. Organization: Kutztown University of Pennsylvania,  USA
  7. Message-ID: <4h763j$2dv@jake.esu.edu>
  8. NNTP-Posting-Host: atlantic.kutztown.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. when I declare a template class in a header file myclass.h and define the 
  12. class (implementation) in a .cpp file myclass.cpp, in my application 
  13. if I only include the .h file, there will be link error, "unresolved 
  14. external symbol", if I include the .cpp file, everything is OK.
  15. If in the .h file is non template class, without including the .cpp file 
  16. there is no problem. 
  17.  
  18. What is my problem? I am using VC++ 4.0. Using Borland C++ 4.5, I met the 
  19. same problem.
  20.  
  21. Any help will be greatly appreciated.
  22.  
  23. Jian
  24.  
  25. pan7064@kutztown.edu
  26.  
  27.  
  28.